home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC-SIG: World of Games
/
PC-SIG World of Games (CDRM1080710) (1993).iso
/
EDU
/
DISK0922.ZIP
/
TUTOR.JEM
< prev
next >
Wrap
Text File
|
1988-09-05
|
24KB
|
551 lines
JEM Tutor
First make a backup of the JEM disk.
If you are unsure how to make a copy read the section in your
DOS manual under the copy command.JEM must have a CGA or a EGA to
work a color monitor is not necessary a mono (one color) monitor
is ok with a CGA EGA.
--------------------------------------
To use this tutorial print this file out to the printer or go
back to DOS and type in "copy tutor.prn prn" hit enter.You will
need a copy of this in front of you to use this tutorial.
This tutorial assumes that you know some DOS commands , if you do
not you will need your DOS manual. This tutorial will teach you
how to use JEM step by step.So start on the first page and go
through it slowly if you have a problem go back a page.After you
get the hang of the commands JEM is very is easy to program in.
First JEM is a LOGO like computer language or a Graphics
language. You can write computer programs in the JEM language that
will create geometric shapes by ordering the Turtle around the
screen. The following tutorial will teach the basic commands of
JEM. The commands must be enter exactly as in this tutorial if the
screen does not look like the tutorial says it should reenter the
commands.
IMPORTANT TYPE IN THE COMMANDS EXACTLY IF A LETTER IS IN
CAPITALS OR IF IT IS SMALLCAPS LOOK CLOSE AT THE COMMAND.
---------------------------------------------------
Put the JEM disk in Drive A , type "jem" the screen should blank
and a small pyramid shape should appear in the center of the
screen. The small pyramid shape is called the Turtle. The display
should also be switched To the 40 character per line mode. The
bottom line of the screen will look like the line below.
?- !
This is the command line all JEM commands are entered here.
Type in help the screen will now be in 80 character per line
mode. The screen will have two columns the column on the left is
the list of the commands "built into JEM" . The column to the
right is a brief description of the command on the left,the last
line reads "Press any Key for more Help".
Press the space bar five (5)times. You have the Turtle in the
center of the screen and the bottom line should look like the line
below if the not press the space bar until the line appears.
?- !
This line is called the command line.
Moving the Turtle forward and back.
To start to order the turtle around the screen type in forw [10]
then hit enter the turtle will move ahead ten (10) spaces. And
will leave a line behind it. Type in back [20] then hit enter the
turtle will back up twenty (20) spaces. Try moving the turtle
forward 15 spaces type in forw [15] hit enter
The turtle should move ahead fifteen spaces. Try moving the turtle
back 12 spaces type in back [12] then hit enter.
Try moving the turtle yourself when you feel confident in moving
the turtle go on to next section.
Clearing the Screen
To clear the screen type in cs hit enter. The screen should be
clear now.
Turning the Turtle
To turn the turtle type in turn [180] hit enter the turtle should
be facing the command line. Type in turn [360] hit enter the
turtle should be facing the top of the screen. The turtle may
turned in any direction between 0 and 360 using this command.
0
270 T 90
180
Think of the top of the screen being 0 degrees and the bottom of
the screen being 180 degrees. Or think of a compass ,the
turn [angle] command will turn the turtle around like the pointer
of a compass.
Hiding and Showing the Turtle
The Turtle may be hidden (made to disappear) type in hide hit
enter. The turtle should be gone type in show hit enter the turtle
should be back. Try this commands a few times.
Drawing Lines and Centering the Turtle
You can turn the line drawing by turtle on or off. Type in the
command upen hit enter. Now type in the command back [25] hit
enter. The turtle will have backed up 25 spaces and there will be
no line drawn. Type in dpen hit enter , type in forw [25] hit
enter. The turtle will have moved forward 25 spaces and drawn a
line. Type in upen forw [30] hit enter the turtle should be 30
spaces forward and there should be no line drawn.
To put the turtle back in the center of the screen type gh hit
enter. The turtle should be in the center of the screen.
Switching Line Colors
You can switch the color of the lines first clear the screen by
using the clear screen command. Type in cs hit enter.
Type in forw [5] Clr [3] forw [5] hit enter. You should have
one line in two different colors. Type in Clr [2] forw [5] hit
enter. The number of pen colors are 4 per palette (between 0 and
3). Try using the Clr command.
Switching Palettes
To switch palettes type in 1 hit enter you now have the first
palette of colors. Type in 2 hit enter you now have the second
palette of colors.
Turning Command line on or off
You can turn the command line on or off to turn the line off type
in Off hit enter. To turn the command line on type in Line hit
enter.
Switching to 80 or 40 Characters per line mode
You can switch from 40 characters per line mode to the 80
character per line mode. Type in Hi hit enter you are now in the
80 character per line mode. Type in med hit enter you are now in
the 40 character per line mode.
Exiting JEM
Type in end hit enter the screen will clear and the dos prompt
will appear.
To go on with this Tutorial -
At the DOS prompt Type in jem hit enter
You will now be back in the the JEM program.
If the user has created a command JEM will ask if you wish to
save the file before returning to DOS.
(Note see loading and saving files).
The next commands are more complex make sure you understand
everything up to this point.
Drawing a Box
Using the commands shown so far you may now order the Turtle to
do some complex commands. Like drawing a box first clear the
screen use the cs command.
Type in cs hit enter.
Type in forw [20] turn [90] forw [20] hit enter.
Type in turn [180] forw [20] hit enter.
Type in turn [270] forw [20] hit enter.
Now to hide the Turtle
Type in hide hit enter.
You will now have a box drawn on the screen.
Now clear the screen and show the Turtle
Type in cs show hit enter
Right and Left Turns
You can turn the turtle right of its current position by using
the right turn command.
Type in rtrn [10] hit enter
(The turtle should be ten degrees right of where it started)
Type in ltrn [10] hit enter
(The turtle should be 1ten degrees left of where it started)
The rtrn [angle] and the ltrn [angle] will turn the turtle from
the current position.
To draw a box using the rtrn command
First Clear the screen
Type in cs hit enter
Type in forw [20] rtrn [90] hit enter.
Type in forw [20] rtrn [90] hit enter.
Type in forw [20] rtrn [90] hit enter.
Type in forw [20] rtrn [90] hit enter.
Type in hide hit enter.
Using the again Command
You can use the again command to make the computer do the hard
work. To use the again command first clear the screen using the
cs command and show the turtle.
Type in cs show hit enter.
Type in agn [4] forw [20] rtrn [90] hit enter
You now have a box on the screen.
Using the Faster command
If speed of the drawing seems slow there is a way to speed the
Turtle up using the F command. First clear the screen.
Type in cs hit enter
Type in F agn [4] forw [20] rtrn [90] hit enter.
This is the fast mode for the Turtle.
Using the Pause Command
If you wish to have the Turtle stop and wait you may use the the
pse command. The pse (pause) command will stop the turtle and wait
for a key to be pressed before going on the next command. To use
the pse command first clear the screen -
Type in cs hit enter
Type in forw [30] pse rtrn [90] forw [20] hit enter
The turtle will go forward 30 spaces and wait now hit any key on
the key board. The turtle will now turn and go forward 20 spaces
and stop.
Switching the Background color
To switch the background color use the B command.
Type in B [3] hit enter
Type in B [0] hit enter
There are 0 to 15 background colors that you can use with a CGA.
To reset to the default settings
Type in cs hit enter
The Repeat Command
The Repeat command will repeat all the commands following it. The
repeat command has to control keys they are the p key and the s
key. When the repeat command is running hitting the p key will
pause the turtle hitting any key but the s key will continue the
Repeat command. If you hit the s key the turtle will stop. to use
the repeat command-
Type in Rept rtrn [93] forw [11] hit enter
To pause the repeat command hit the the p key.
(Note do not hit the enter key)
To continue the repeat hit the spacebar.
(Note do not hit the enter key)
To stop the repeat -
Hit the p key then hit the s key.
(Note do not hit the enter key).
Type in cs hit enter
To Enter Text on the screen
To enter text on the screen use the T command. To use the text
command-
Type in T [2] Hello There , hit enter
The number in the brackets is the line number to write the text.
The message you wish displayed on the screen must end with a
comma.
Creating your own programs or commands
JEM allows you to create your own commands using the commands you
have be shown. To create your own commands
Type in expl hit enter
Type in tell hit enter
Type in Rightbox= F agn [4] forw [30] rtrn [90] ; hit enter
The screen will now be back with the turtle and the command line.
Type in Rightbox hit enter.
The turtle will have drawn the box.
Listing your own commands
Jem allows you to list your commands that you have created by
using the the show command. To list your commands -
Type in expl hit enter
Type in show hit enter
Type in all hit enter
Jem will now list all the commands or words in memory.
Forgetting a command you have created
Jem allows you to forget or get rid of commands that you do not
want or simple do not work as planned. To use the forget command-
Type in expl hit enter
Type in forget hit enter
Type in Rightbox hit enter
Hit enter
Hit enter
The command Rightbox is now gone.
Loading Files
To load a file use the G command to use the the get file command-
Type in G hit enter
You will now be asked for the file name -
Type in jem.dat hit enter
(Note if JEM.DAT has been removed from your disk you will get a
error comment)
Type in expl hit enter
Type in show hit enter
Type in all hit enter
Hit the enter key until you get the command line back.
When the Turtle and the command line return -
Type in window hit enter
You now have a window on the screen.
List the commands again and try some of the words listed in
jem.dat
Saving Files
If you use the expl command during a session when you enter the
end command Jem will ask you if you wish to save the word file if
you answer yes you will be asked for the name you wish to give the
file. Or you may use the the Save command to use the the save
command.
Type in S hit enter
You then be asked to give a file name
Type in Myfile.dat hit enter
Chaining Files
JEM allows you chain files and commands to use this command you
must know the file name and the first command you wish to execute
in that file.
Type in Do "jem.dat window" hit enter
Jem will load the file jem.dat and execute the command window.
The Do command can be used to load files also to use as file
loader only see page 9.
Auto Run JEM
Jem allows you to create an auto run file or an auto load file to
use the auto feature. You must use the file name jem.run rename or
create a file with this name. To use the the auto run feature the
word or command startup must be in the jem.run file. The command
startup can be defined as what ever you wish.(See page 9)
Variables
Jem allows two variables they are var1 and var2. To set the value
in the variables -
Type in s [var1=1] hit enter
Type in s [var2=5] hit enter
To add to the current value of the variables
Type in s [var1+2] hit enter
(this will add 2 to the current value of var1)
Type in s [var2+3] hit enter
(this will add 3 to the current value of var2)
To subtract to the current value of the variables
Type in s [var1-2] hit enter
(this will subtract 2 from the current value of var1)
Type in s [var2-3] hit enter
(this will subtract 3 from the current value of var2)
To use a variable -
Type in forw [var1] turn [var2] hit enter
Screen wrap ON or OFF
The screen normally wraps around that is to say that the turtle
if it goes off the top of the screen it will appear at the bottom
of the screen. You can turn the the wrap off if you wish that
means the turtle will not appear at the bottom of the screen if
the turtle runs off the top of the screen. The command to turn the
wrap off is nwrp to turn the wrap on the command is wrap.
To print out JEM's display turn the command line off,turn your
printer on, hit the print screen key.
JEM is language similar to the computer language FORTH , user
words or commands may definded using the pre-defined commands
and/or user defined commands to create more commands. Load the
file JEM.DAT to see examples of user created commands.
Chaining of files the user can chain any number of files to each
other. The Auto run feature must have the JEM.RUN in the same
directory as JEM.COM and the word startup must be used in the file
JEM.RUN to start the auto run feature. To see how the auto feature
works rename the file JEM2.DAT as JEM.RUN the load JEM. There is a
small demonstration command in that file.
User defined commands can be repeated in the same data file but
JEM will use the first definition only. The same word can be
defined in a different file as a different command. User defined
commands must be longer than five (5) characters in length for JEM
to use them.
When using the ag (again) command care must used not to nest the
the again command. Example of a nested command is ag [5] forw [10]
ag [4] forw [10] rtrn [3].
To use the Do command to load files only simply do not give the
command a word to execute. Example of a file load using the the
Do commmand.
Type in Do jem.dat hit enter
Jem will load the file and return to the command line.
Also a user defined command can call itself if you do this JEM
will go in to endless loop. You can try Ctrl c to stop JEM but you
may need to shut the system off to end the loop.
Look at the JEM.DOC for addition information see next page for
command abbreviations.
Jem basic commands can be shorten to one character to save time
and space when the user creates their own commands here is a list
of the shorten commands.
Function Command Short Command
Moving the turtle forward forw [spaces] f [spaces]
Moving the turtle backwards back [spaces] b [spaces]
Clear screen cs c
Turn to a compass point turn [angle] t [angle]
Hide the turtle from view hide h
Show the turtle show s
Turtle pen up upen u
Turtle pen down dpen d
Switch line colors Clr [number] C [number]
Switch to Palette 1 1 1
Switch to Palette 2 2 2
Command line on Line L
Command line off Off O
40 Chars per line(default) med m
80 Chars per line Hi H
Exiting JEM end end
Right turns rtrn [angle] r [angle]
Left turns ltrn [angle] l [angle]
Again x times agn [times] a [times]
Faster command Fast F
Pause wait foe keypress pse p
Seting Background Color Back [number] B [number]
Repeat Command Rept R
Put text on screen T [line] here , T [line] here,
Get a data file G G
Get a data file Do filename D filename
Save a data file Save S
Get file Do a command Do file command D file command
Screen wrap on wrap w
Screen wrap off nwrp n
Variable # 1 var1 var1
Variable # 2 var2 var2
Explain to Turtle explain exp
The following page will let you try some user defined commands in
the data file JEM.DAT to see how the commands work.
You can get a print out of the file JEM.DAT to look at by going to
DOS put the JEM disk in the disk drive. At the DOS prompt-
Type in copy jem.dat prn hit enter
After the printer is done load the JEM program at the DOS
prompt -
Type in jem hit enter
This page has a number of commands in the JEM.DAT file the user
can try and look at. First load the data file jem.dat-
Type in D jem.dat hit enter
Type in R shapes hit enter
Jem will draw a number of shapes on the screen
Type in cs R shapes2 hit enter
Jem will draw some more shapes on the screen
To see the difference in drawing speed using the Repeat command
try this
Type in cs shapes2 hit enter
When the turtle is finshed try the same word using the Faster
command.
Type in cs F shapes2 hit enter
There is a noticeable difference in drawing speed.
You can use the turtle to draw letters also try
Type in cs F startwrite hit enter
Now you can try some of the other words in the JEM.DAT file. Try
creating some words try
Type in expl hit enter
Type in tell hit enter
Type in myword1= cs F startwrite ; hit enter
Get back to the command line and the turtle on the screen then -
Type in myword1 hit enter
Try creating your own words on your own now.
Index
Page 1 Command line, help command
Page 2 Moving the Turtle forw , back commands
Page 2 Clearing the screen cs command
Page 2 Turning the Turtle turn command
Page 3 Turtle on or off hide,show command
Page 3 Drawing lines penup pendown command
Page 3 Centering the Turtle gohome command
Page 3 Switching line colors Color command
Page 3 Color Palettes 1 , 2 commands
Page 3 Command line off Off Line command
Page 3 80 ,40 Chars pre line Hi ,Med command
Page 4 Ending a Jem session end command
Page 4 Drawing a simple Box
Page 4 Right turn command rtrn command
Page 4 Left turn command ltrn command
Page 4 Using the rtrn command
Page 4 Using the again command agn command
Page 5 Using the Faster command F command
Page 5 Using the Repeat command R command
Page 5 Switching the Background color B command
Page 5 Using the Pause command P command
Page 5 Using the Text command T command
Page 6 Creating Commands
Page 6 Using the explain command expl command
Page 6 Using the list command show command
Page 6 Forgetting a command forget command
Page 7 File handing
Page 7 Loading a data file Get command
Page 7 Auto command excute Do command
Page 9 Loading a data file Do command
Page 7 Saving a data file Save command
Page 7 Automatic load and run of JEM
Page 8 Variables
Page 8 Setting the variable value
Page 8 Addition with the variables
Page 8 Subtraction of the variables
Page 8 Screen wrap on or off
Page 8 Using nwrp command
Page 8 Using wrap command
Page 9 Chaining data files
Page 10 Basic Command Short hand
Page 11 Using the tell command
Page 11 Creating commands
Page 11 Practice using commands